/**
 * 自定义加载store模块
 */
// 本方法不建议使用，因为会加载modules下所有文件，要求所有文件无错，否则不能继续
function loadModules() {
	const context: any = import.meta.glob("./modules/*.ts", {eager: false});
	const modules: any = {};
	let keys = Object.keys(context);
	for (let key of keys) {
		if (key === "./index.ts") return;
		let module = context[key];
		let name = key.replace(/(\.\/modules\/|\.ts)/g, '');
		modules[name] = module
	}
	return modules
}

// let store = {};
//指定导出
// import {useAppStore} from "@store/app";
// import {useStoreTheme} from "@store/theme";
//
// store['app'] = useAppStore;
// store['theme'] = useStoreTheme;
const store = loadModules();
export default store;
